export const pages = {
  back: function (cb) {
    const pages = getCurrentPages();
    const prevPage = pages[pages.length - 2];
    if (cb) cb(prevPage);
    wx.navigateBack({
      delta: 1
    })
  },
  top: function () {
    return getCurrentPages()[0]
  },
  previous: function () {
    const pages = getCurrentPages();
    return pages[pages.length - 2];
  }
}